package com.example.pickupclosefirstdemo.main;

import android.view.View;

import androidx.databinding.ObservableField;
import androidx.lifecycle.ViewModel;

import com.example.pickupclosefirstdemo.R;

public class Teacher extends ViewModel {

    public ObservableField<String> teacherName = new ObservableField<>();

    public ObservableField<String> getTeacherName() {
        return teacherName;
    }

    /**
     * 此方法MainActivity的xml文件中
     * 两个button的OnClick方法调用
     * @param view
     */
    public void setBean(View view){
        switch (view.getId()){
            case R.id.btnModuleAdd:
                teacherName.set("孙冰");
                break;
            case R.id.btnModuleDelete:
                teacherName.set("李娜");
                break;
                default:
        }
    }
}
